<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

#APP-API
#不传Token 加密
Route::group([
    'namespace'     => 'System',
    'prefix'        => 'system',
    'middleware'    => [
        'Security',
    ]
], function () {
    Route::post('initApp', 'SystemSettingController@initApp');#注册
});



#不传Token 加密 不用登录
Route::group([
    'namespace'     => 'User',
    'prefix'        => 'user',
    'middleware'    => [
        'Security',
    ]
], function () {
    Route::post('register',     'LoginController@register');#注册
    Route::post('sign',         'LoginController@sign');#登录
    Route::post('VipCardList',  'UserController@VipCardList');#会员卡充值列表
});

#不传Token 加密 首页
Route::group([
    'namespace'     => 'Index',
    'prefix'        => 'index',
    'middleware'    => [
        'Security',
    ]
], function () {
    Route::post('banner',           'BannerController@index');#轮播图
    Route::post('live',             'LiveController@index');#直播平台列表
    Route::post('movie/cateList',   'MovieController@cateList');#电影分类
    Route::post('movie/hot',        'MovieController@hot');#热门电影
    Route::post('movie/recommend',  'MovieController@recommend');#推荐视频
    Route::post('movie/cate',       'MovieController@cate');#分类电影
    Route::post('video/recommend',  'VideoController@recommend');#推荐视频
    Route::post('amuse/hot',        'AmuseController@index');#娱乐首页
    Route::post('amuse/cate',       'AmuseController@cate');#分类娱乐
});


#传Token 加密 必须登录
Route::group([
    'namespace'     => 'Index',
    'prefix'        => 'index',
    'middleware'    => [
        'Security',
        'UserToken',
    ]
], function () {
    Route::post('movie/detail',     'MovieController@detail');#电影详情
    Route::post('movie/collect',    'MovieController@collect');#收藏电影
    Route::post('video/hot',        'VideoController@hot');#热门视频
    Route::post('video/detail',     'VideoController@detail');#视频详情
    Route::post('video/follow',     'VideoController@follow');#关注视频发布者
});

#传Token 加密 必须登录
Route::group([
    'namespace'     => 'User',
    'prefix'        => 'user',
    'middleware'    => [
        'Security',
        'UserToken',
    ]
], function () {
    Route::post('personalPage',         'IndexController@personalPage');#个人主页
    Route::post('videoList',            'IndexController@videoList');#用户的视频列表
    Route::post('superiorPhone',        'IndexController@superiorPhone');#获取上级用户联系方式
    Route::post('modifySign',           'IndexController@modifySign');#编辑个性签名
    Route::post('modifyPhone',          'IndexController@modifyPhone');#编辑联系方式
    Route::post('collectList',          'IndexController@collectList');#收藏的电影列表
    Route::post('followList',           'IndexController@followList');#关注列表
    Route::post('upload',               'IndexController@upload');#视频上传
    Route::post('reset',                'LoginController@reset');#修改密码
    Route::post('card/create',          'UserController@create');#生成卡密
    Route::post('card/list',            'UserController@cardList');#我的卡密列表
    Route::post('card/activateList',    'UserController@activateList');#卡密激活列表
    Route::post('card/renew',           'IndexController@renew');#会员续费
    Route::post('agent/transferScore',  'UserController@transferScore');#转积分
    Route::post('agent/open',           'UserController@openAgent');#开下级代理
    Route::post('agent/info',           'UserController@agentInfo');#代理信息
});


#后台
#传Token  必须登录
Route::group([
    'namespace'     => 'Admin',
    'prefix'        => 'admin',
    'middleware'    => [
        'admin.auth',
    ]
], function () {
    Route::post('logout',               'LoginController@logout');#退出登录
    Route::post('modifyPassword',       'LoginController@modifyPassword');#修改密码
    Route::post('user/list',            'UserController@index');#后台用户列表
    Route::post('user/change',          'UserController@changeStatus');#更改用户状态
    Route::post('user/delete',          'UserController@delete');#删除用户
    Route::post('user/add',             'UserController@addUser');#新增用户
    Route::post('agent/list',           'UserController@agentList');#代理商列表
    Route::post('agent/add',            'UserController@addAgent');#新增代理商
    Route::post('agent/edit',           'UserController@edit');#编辑代理商
    Route::post('agent/subordinate',    'UserController@subordinate');#下级用户列表
    Route::post('agent/recharge',       'UserController@recharge');#充值积分
    Route::post('agent/delete',         'UserController@delete');#删除代理商
    Route::post('card/list',            'CardController@index');#卡密列表
    Route::post('water/list',           'WaterController@index');#积分记录列表
    Route::post('setting/list',         'SystemSettingController@getAllSystemSetting');#获取所有配置
    Route::post('setting/modify',       'SystemSettingController@modifySetting');#新增/修改配置
    Route::post('setting/del',          'SystemSettingController@del');#删除配置
    Route::post('boot/list',            'BootController@getBootConf');#获取启动页和引导页
    Route::post('boot/modify',          'BootController@modifyBoot');##新增/修改 启动引导
    Route::post('boot/del',             'BootController@del');#删除启动引导
    Route::post('banner/list',          'BannerController@getBanner');#获取banner
    Route::post('banner/modify',        'BannerController@modifyBanner');#修改banner
    Route::post('banner/del',           'BannerController@del');#删除banner
    Route::post('vip/list',             'VipCardController@getVipCard');#获取vip卡列表
    Route::post('vip/modify',           'VipCardController@modifyVip');#修改vip卡所需积分
    Route::post('video/list',           'LiveVideoController@getVideoList');#获取视频列表
    Route::post('video/modify',         'LiveVideoController@modifyVideo');#修改 视频
    Route::post('video/check',          'LiveVideoController@check');#审核视频
    Route::post('video/del',            'LiveVideoController@del');#删除视频
    Route::post('amuse/cateList',       'LiveAmuseCateController@getAmuseCateList');#获取娱乐分类
    Route::post('amuse/modifyCate',     'LiveAmuseCateController@modifyAmuseCate');#修改|新增 娱乐分类
    Route::post('amuse/delCate',        'LiveAmuseCateController@del');#删除娱乐分类
    Route::post('amuse/amuseList',      'LiveAmuseController@getAmuseList');#获取娱乐列表
    Route::post('amuse/modifyAmuse',    'LiveAmuseController@modifyAmuse');#修改|新增 娱乐
    Route::post('amuse/delAmuse',       'LiveAmuseController@del');#删除娱乐
    Route::post('movie/cateList',       'LiveMovieCateController@getMovieCateList');#电影分类列表
    Route::post('movie/modifyCate',     'LiveMovieCateController@modifyMovieCate');#修改|新增电影分类
    Route::post('movie/delCate',        'LiveMovieCateController@del');#删除电影分类
    Route::post('movie/movieList',      'LiveMovieController@getMovieList');#电影列表
    Route::post('movie/modifyMovie',    'LiveMovieController@modifyMovie');#修改|新增电影
    Route::post('movie/delMovie',       'LiveMovieController@del');#删除电影
    Route::post('upload',               'UploadController@save');#文件上传
});

#后台 不传Token 登录
Route::group([
    'namespace'     => 'Admin',
    'prefix'        => 'admin',
    'middleware'    => [
        //'Security',
    ]
], function () {
    Route::post('login',            'LoginController@sign');#后台登录

});